const {createStore} = require('redux');

const store = createStore((state={count:1},action) => {
    switch (action.type) {
        case 'ADD':
            return {
                ...state,
                count:state.count + 1
            }
        default:
            return state;
    }
})

console.log(store.getState());

store.dispatch({
    type:'ADD'
})

console.log(store.getState());